<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/templates/newMainTemplateWithFooter.xhtml">
    
    <ui:define name="newContent">
       
        <h:form id="loginForm">
            <p:growl id="growl" showDetail="false" life="3000" />
            
            <p:panel header="#{indexMessages.Login}" styleClass="noBorder noMarginLeft noMarginRight marginTopBar" >
                <p:inputText styleClass="width100" id="loginEmail" value="#{loginBean.email}" required="true" requiredMessage="#{messages.EmailRequired}" label="#{messages.Email}">  
                    <f:validator  binding="#{loginEmailValidator}"></f:validator>
                    <p:ajax event="change" update="growl" />
                </p:inputText> 
                <p:watermark for="loginEmail" value="#{messages.Email}" /> 
                <p:password style="margin-bottom: 1em!important" styleClass="width100" id="loginPassword" value="#{loginBean.password}" required="true" requiredMessage="#{messages.PasswordRequired}" label="#{messages.Password}">
                    <f:validateLength minimum="5" maximum="30"></f:validateLength>
                    <p:watermark for="loginPassword" value="#{messages.Password}" />
                </p:password>
                <p:commandLink process="@this" action="RecoverPassword?faces-redirect=true" style="margin-bottom:  20px" styleClass="bodyText block marginBotton" value="#{messages.ForgotPassword}"></p:commandLink>
                <div>
                    <p:commandButton style="margin-bottom: 1em;margin-left: 0.3em;" styleClass="landingButton loginLandingButton blueBackgroundStrong " process="@parent" value="#{messages.LogIn}" update=":loginForm:growl" id="loginButton" action="#{loginBean.logIn}" />
                    <p:commandButton style="margin-bottom: 1em;margin-left: 0.3em;" styleClass="landingButton loginLandingButton grayBackgroundStrong " process="@this" value="#{indexMessages.Back}" id="backButton" action="/index?faces-redirect=true" />
                </div>
            </p:panel>
        </h:form>
    </ui:define>

</ui:composition>
</html>